load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "tochar",
    srcs = [
        "cache.go",
        "constants.go",
        "tochar.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/util/tochar",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/util/cache",
        "//pkg/util/duration",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil/pgdate",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "tochar_test",
    srcs = [
        "cache_test.go",
        "tochar_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":tochar"],
    deps = [
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/types",
        "//pkg/util/duration",
        "//pkg/util/timeutil",
        "//pkg/util/timeutil/pgdate",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
